
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第二节 前向传播 · Tensorflow学习笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="scottdu">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="section1.3.html" />
    
    
    <link rel="prev" href="section1.1.html" />
    

    
    <link rel="stylesheet" href="../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    第一章 Tensorflow框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="section1.1.html">
            
                <a href="section1.1.html">
            
                    
                    第一节 张量、计算图、会话
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="section1.2.html">
            
                <a href="section1.2.html">
            
                    
                    第二节 前向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="section1.3.html">
            
                <a href="section1.3.html">
            
                    
                    第三节 反向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="section1.4.html">
            
                <a href="section1.4.html">
            
                    
                    第四节 搭建神经网络的步骤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    第二章 神经网络优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/section2.1.html">
            
                <a href="../chapter2/section2.1.html">
            
                    
                    第一节 损失函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/section2.2.html">
            
                <a href="../chapter2/section2.2.html">
            
                    
                    第二节 学习率
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/section2.3.html">
            
                <a href="../chapter2/section2.3.html">
            
                    
                    第三节 滑动平均
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/section2.4.html">
            
                <a href="../chapter2/section2.4.html">
            
                    
                    第四节 正则化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter2/section2.5.html">
            
                <a href="../chapter2/section2.5.html">
            
                    
                    第五节 神经网络的搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    第三章 全连接网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter3/section3.1.html">
            
                <a href="../chapter3/section3.1.html">
            
                    
                    第一节 MINIST数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter3/section3.2.html">
            
                <a href="../chapter3/section3.2.html">
            
                    
                    第二节 模块化搭建神经网络方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter3/section3.3.html">
            
                <a href="../chapter3/section3.3.html">
            
                    
                    第三节 手写数字识别准确率输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    第四章 全连接网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/section4.1.html">
            
                <a href="../chapter4/section4.1.html">
            
                    
                    第一节 输入手写数字图片输出识别结果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/section4.2.html">
            
                <a href="../chapter4/section4.2.html">
            
                    
                    第二节 制作数据集
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    第五章 卷积网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/section5.1.html">
            
                <a href="../chapter5/section5.1.html">
            
                    
                    第一节 卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/section5.2.html">
            
                <a href="../chapter5/section5.2.html">
            
                    
                    第二节 lenel5代码讲解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    第六章 卷积网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/section6.1.html">
            
                <a href="../chapter5/section6.1.html">
            
                    
                    第一节 复现已有的卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/section6.2.html">
            
                <a href="../chapter6/section6.2.html">
            
                    
                    第二节 用vgg16实现图片识别
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    第七章 Tensorflow应用
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >第二节 前向传播</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;&#x4E8C;&#x8282;-&#x524D;&#x5411;&#x4F20;&#x64AD;">&#x7B2C;&#x4E8C;&#x8282; &#x524D;&#x5411;&#x4F20;&#x64AD;</h1>
<ul>
<li>&#x524D;&#x5411;&#x4F20;&#x64AD;&#x5C31;&#x662F;&#x642D;&#x5EFA;&#x6A21;&#x578B;&#x7684;&#x8BA1;&#x7B97;&#x8FC7;&#x7A0B;&#xFF0C;&#x8BA9;&#x6A21;&#x578B;&#x5177;&#x6709;&#x63A8;&#x7406;&#x80FD;&#x529B;&#xFF0C;&#x53EF;&#x4EE5;&#x9488;&#x5BF9;&#x4E00;&#x7EC4;&#x8F93;&#x5165; &#x7ED9;&#x51FA;&#x76F8;&#x5E94;&#x7684;&#x8F93;&#x51FA;&#x3002;</li>
</ul>
<p>&#x4E3E;&#x4F8B;: &#x5047;&#x5982;&#x751F;&#x4EA7;&#x4E00;&#x6279;&#x96F6;&#x4EF6;&#xFF0C;&#x4F53;&#x79EF;&#x4E3A;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>x</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">x_1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.43056em;"></span><span class="strut bottom" style="height:0.58056em;vertical-align:-0.15em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit">x</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:0em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#xFF0C;&#x91CD;&#x91CF;&#x4E3A;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>x</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">x_2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.43056em;"></span><span class="strut bottom" style="height:0.58056em;vertical-align:-0.15em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit">x</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:0em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord mathrm mtight">2</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#xFF0C;&#x4F53;&#x79EF;&#x548C;&#x91CD;&#x91CF;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x9009;&#x62E9;&#x7684;&#x7279;&#x5F81;&#xFF0C; &#x628A;&#x5B83;&#x4EEC;&#x5582;&#x5165;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#xFF0C;&#x5F53;&#x4F53;&#x79EF;&#x548C;&#x91CD;&#x91CF;&#x8FD9;&#x7EC4;&#x6570;&#x636E;&#x8D70;&#x8FC7;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x540E;&#x4F1A;&#x5F97;&#x5230;&#x4E00;&#x4E2A;&#x8F93;&#x51FA;&#x3002;
&#x5047;&#x5982;&#x8F93;&#x5165;&#x7684;&#x7279;&#x5F81;&#x503C;&#x662F;: &#x4F53;&#x79EF;<code>0.7</code>&#x91CD;&#x91CF;<code>0.5</code></p>
<p><img src="http://ovhbzkbox.bkt.clouddn.com/2018-07-17-15318051293124.jpg" alt=""></p>
<p>&#x7531;&#x642D;&#x5EFA;&#x7684;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x53EF;&#x5F97;&#xFF0C;&#x9690;&#x85CF;&#x5C42;&#x8282;&#x70B9; <code>a11=x1* w11+x2*w21=0.14+0.15=0.29</code>&#xFF0C;&#x540C;&#x7406;&#x7B97;&#x5F97;&#x8282;&#x70B9; <code>a12=0.32</code>&#xFF0C;<code>a13=0.38</code>&#xFF0C;&#x6700;&#x7EC8;&#x8BA1;&#x7B97;&#x5F97;&#x5230;&#x8F93;&#x51FA;&#x5C42;<code>Y=-0.015</code>&#xFF0C;&#x8FD9;&#x4FBF;&#x5B9E;&#x73B0;&#x4E86; &#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x3002;</p>
<ul>
<li>&#x63A8;&#x5BFC;</li>
</ul>
<h4 id="&#x7B2C;&#x4E00;&#x5C42;">&#x7B2C;&#x4E00;&#x5C42;</h4>
<ul>
<li><code>X</code>&#x662F;&#x8F93;&#x5165;&#x4E3A;<code>1X2</code>&#x7684;&#x77E9;&#x9635;:</li>
</ul>
<blockquote>
<p>&#x7528;<code>x</code>&#x8868;&#x793A;&#x8F93;&#x5165;&#xFF0C;&#x662F;&#x4E00;&#x4E2A;1&#x884C;2&#x5217;&#x77E9;&#x9635;&#xFF0C;&#x8868;&#x793A;&#x4E00;&#x6B21;&#x8F93;&#x5165;&#x4E00;&#x7EC4;&#x7279;&#x5F81;&#xFF0C;&#x8FD9;&#x7EC4;&#x7279;&#x5F81;&#x5305;&#x542B;&#x4E86;&#x4F53;&#x79EF;&#x548C;&#x91CD;&#x91CF;&#x4E24;&#x4E2A;&#x5143;&#x7D20;&#x3002;</p>
</blockquote>
<ul>
<li><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msubsup><mi>W</mi><mrow><mi>p</mi><mi>r</mi><mi>e</mi><mo>&#x2212;</mo><mi>n</mi><mi>o</mi><mi>d</mi><mi>e</mi><mo separator="true">,</mo><mi>p</mi><mi>o</mi><mi>s</mi><mi>t</mi><mo>&#x2212;</mo><mi>n</mi><mi>o</mi><mi>d</mi><mi>e</mi></mrow><mrow><mo>(</mo><mi>l</mi><mi>a</mi><mi>y</mi><mi>e</mi><mi>r</mi><mo>)</mo></mrow></msubsup></mrow><annotation encoding="application/x-tex">W_{pre-node,post-node}^{(layer)}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:1.0448em;"></span><span class="strut bottom" style="height:1.4822159999999998em;vertical-align:-0.4374159999999999em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:0.3013079999999999em;margin-left:-0.13889em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathit mtight">p</span><span class="mord mathit mtight" style="margin-right:0.02778em;">r</span><span class="mord mathit mtight">e</span><span class="mbin mtight">&#x2212;</span><span class="mord mathit mtight">n</span><span class="mord mathit mtight">o</span><span class="mord mathit mtight">d</span><span class="mord mathit mtight">e</span><span class="mpunct mtight">,</span><span class="mord mathit mtight">p</span><span class="mord mathit mtight">o</span><span class="mord mathit mtight">s</span><span class="mord mathit mtight">t</span><span class="mbin mtight">&#x2212;</span><span class="mord mathit mtight">n</span><span class="mord mathit mtight">o</span><span class="mord mathit mtight">d</span><span class="mord mathit mtight">e</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathit mtight" style="margin-right:0.01968em;">l</span><span class="mord mathit mtight">a</span><span class="mord mathit mtight" style="margin-right:0.03588em;">y</span><span class="mord mathit mtight">e</span><span class="mord mathit mtight" style="margin-right:0.02778em;">r</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x4E3A;&#x5F85;&#x4F18;&#x5316;&#x7684;&#x53C2;&#x6570;</li>
</ul>
<blockquote>
<p>&#x5BF9;&#x4E8E;&#x7B2C;&#x4E00;&#x5C42;&#x7684;w &#x524D;&#x9762;&#x6709;&#x4E24;&#x4E2A;&#x8282;&#x70B9;&#xFF0C;&#x540E;&#x9762;&#x6709;&#x4E09;&#x4E2A;&#x8282;&#x70B9; w&#x5E94;&#x8BE5;&#x662F;&#x4E2A;&#x4E24;&#x884C;&#x4E09;&#x5217;&#x77E9;&#x9635;&#xFF0C;&#x6211;&#x4EEC;&#x8FD9;&#x6837;&#x8868;&#x793A;:</p>
</blockquote>
<p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>w</mi><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msup><mo>=</mo><mrow><mo fence="true">[</mo><mtable><mtr><mtd><mrow><msubsup><mi>w</mi><mrow><mn>1</mn><mo separator="true">,</mo><mn>1</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd><mtd><mrow><msubsup><mi>w</mi><mrow><mn>1</mn><mo separator="true">,</mo><mn>2</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd><mtd><mrow><msubsup><mi>w</mi><mrow><mn>1</mn><mo separator="true">,</mo><mn>3</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd></mtr><mtr><mtd><mrow><msubsup><mi>w</mi><mrow><mn>2</mn><mo separator="true">,</mo><mn>1</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd><mtd><mrow><msubsup><mi>w</mi><mrow><mn>2</mn><mo separator="true">,</mo><mn>2</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd><mtd><mrow><msubsup><mi>w</mi><mrow><mn>2</mn><mo separator="true">,</mo><mn>3</mn></mrow><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msubsup></mrow></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">
w^{(1)}=
\left[ \begin{array}{ccc}
w_{1,1}^{(1)} &amp; w_{1,2}^{(1)} &amp; w_{1,3}^{(1)}\\
w_{2,1}^{(1)} &amp; w_{2,2}^{(1)} &amp; w_{2,3}^{(1)}
\end{array}\right ]
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:1.75em;"></span><span class="strut bottom" style="height:3.0000299999999998em;vertical-align:-1.25003em;"></span><span class="base displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:-0.413em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mrel">=</span><span class="minner displaystyle textstyle uncramped"><span class="mopen style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size4">[</span></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist"><span style="top:-0.6524160000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">1</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span style="top:0.7948000000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">2</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">1</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist"><span style="top:-0.6524160000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">2</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span style="top:0.7948000000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">2</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">2</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist"><span style="top:-0.6524160000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">3</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span style="top:0.7948000000000001em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist"><span style="top:0.266308em;margin-left:-0.02691em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">2</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">3</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span><span class="mclose style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size4">]</span></span></span></span></span></span></span></p>
<ul>
<li>&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x5171;&#x6709;&#x51E0;&#x5C42;(&#x6216;&#x5F53;&#x524D;&#x662F;&#x7B2C;&#x51E0;&#x5C42;&#x7F51;&#x7EDC;)&#x90FD;&#x662F;&#x6307;&#x7684;&#x8BA1;&#x7B97;&#x5C42;&#xFF0C;&#x8F93;&#x5165;&#x4E0D;&#x662F;&#x8BA1;&#x7B97;&#x5C42;&#xFF0C; &#x6240;&#x4EE5;<code>a</code>&#x4E3A;&#x7B2C;&#x4E00;&#x5C42;&#x7F51;&#x7EDC;&#xFF0C;<code>a</code>&#x662F;&#x4E00;&#x4E2A;&#x4E00;&#x884C;&#x4E09;&#x5217;&#x77E9;&#x9635;&#x3002;
&#x6211;&#x4EEC;&#x8FD9;&#x6837;&#x8868;&#x793A;:</li>
</ul>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>a</mi><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msup><mo>=</mo><mo>[</mo><msub><mi>a</mi><mrow><mn>1</mn><mn>1</mn></mrow></msub><mo separator="true">,</mo><msub><mi>a</mi><mrow><mn>1</mn><mn>2</mn></mrow></msub><mo separator="true">,</mo><msub><mi>a</mi><mrow><mn>1</mn><mn>3</mn></mrow></msub><mo>]</mo><mo>=</mo><mi>X</mi><msup><mi>W</mi><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">a^{(1)}=[a_{11},a_{12},a_{13}]=XW^{(1)}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8879999999999999em;"></span><span class="strut bottom" style="height:1.138em;vertical-align:-0.25em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mrel">=</span><span class="mopen">[</span><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:0em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mord mathrm mtight">1</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mpunct">,</span><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:0em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mord mathrm mtight">2</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mpunct">,</span><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:0em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mord mathrm mtight">1</span><span class="mord mathrm mtight">3</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mclose">]</span><span class="mrel">=</span><span class="mord mathit" style="margin-right:0.07847em;">X</span><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span></p>
<h4 id="&#x7B2C;&#x4E8C;&#x5C42;">&#x7B2C;&#x4E8C;&#x5C42;</h4>
<ul>
<li>&#x53C2;&#x6570;&#x8981;&#x6EE1;&#x8DB3;&#x524D;&#x9762;&#x4E09;&#x4E2A;&#x8282;&#x70B9;&#xFF0C;&#x540E;&#x9762;&#x4E00;&#x4E2A;&#x8282;&#x70B9;&#xFF0C;&#x6240;&#x4EE5;<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>W</mi><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">W^{(2)}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8879999999999999em;"></span><span class="strut bottom" style="height:0.8879999999999999em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span>&#x662F;&#x4E09;&#x884C;&#x4E00;&#x5217;&#x77E9;&#x9635;&#x3002;&#x6211;&#x4EEC;&#x8FD9;&#x6837;&#x8868;&#x793A;&#xFF1A;</li>
</ul>
<p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>W</mi><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></msup><mo>=</mo><mrow><mo fence="true">[</mo><mtable><mtr><mtd><mrow><msubsup><mi>W</mi><mrow><mo>(</mo><mn>1</mn><mo separator="true">,</mo><mn>1</mn><mo>)</mo></mrow><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></msubsup></mrow></mtd></mtr><mtr><mtd><mrow><msubsup><mi>W</mi><mrow><mo>(</mo><mn>2</mn><mo separator="true">,</mo><mn>1</mn><mo>)</mo></mrow><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></msubsup></mrow></mtd></mtr><mtr><mtd><mrow><msubsup><mi>W</mi><mrow><mo>(</mo><mn>3</mn><mo separator="true">,</mo><mn>1</mn><mo>)</mo></mrow><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></msubsup></mrow></mtd></mtr></mtable><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">
W^{(2)}=\left[ \begin{array}{ccc}
W_{(1,1)}^{(2)}\\W_{(2,1)}^{(2)}\\W_{(3,1)}^{(2)}
\end{array}\right ]
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:2.6520099999999998em;"></span><span class="strut bottom" style="height:4.80204em;vertical-align:-2.15003em;"></span><span class="base displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:-0.413em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mrel">=</span><span class="minner displaystyle textstyle uncramped"><span class="mopen style-wrap reset-textstyle textstyle uncramped"><span class="delimsizing mult"><span class="vlist"><span style="top:1.50501em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A3;</span></span></span><span style="top:0.35001000000000015em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A2;</span></span></span><span style="top:-0.2509899999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A2;</span></span></span><span style="top:-1.49701em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A1;</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist"><span style="top:-1.5452em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:0.3401999999999999em;margin-left:-0.13889em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">1</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span style="top:0.014800000000000368em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:0.3401999999999999em;margin-left:-0.13889em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span style="top:1.5748em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="mord displaystyle textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.13889em;">W</span><span class="msupsub"><span class="vlist"><span style="top:0.3401999999999999em;margin-left:-0.13889em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle cramped mtight"><span class="mord scriptstyle cramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">3</span><span class="mpunct mtight">,</span><span class="mord mathrm mtight">1</span><span class="mclose mtight">)</span></span></span></span><span style="top:-0.5198em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord scriptstyle uncramped mtight"><span class="mopen mtight">(</span><span class="mord mathrm mtight">2</span><span class="mclose mtight">)</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span><span class="mclose style-wrap reset-textstyle textstyle uncramped"><span class="delimsizing mult"><span class="vlist"><span style="top:1.50501em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A6;</span></span></span><span style="top:0.35001000000000015em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A5;</span></span></span><span style="top:-0.2509899999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A5;</span></span></span><span style="top:-1.49701em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span><span class="delimsizinginner delim-size4"><span>&#x23A4;</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">&#x200B;</span></span>&#x200B;</span></span></span></span></span></span></span></span></span></p>
<p>&#x6211;&#x4EEC;&#x628A;&#x6BCF;&#x5C42;&#x8F93;&#x5165;&#x4E58;&#x4EE5;&#x7EBF;&#x4E0A;&#x7684;&#x6743;&#x91CD;<code>w</code>&#xFF0C;&#x8FD9;&#x6837;&#x7528;&#x77E9;&#x9635;&#x4E58;&#x6CD5;&#x53EF;&#x4EE5;&#x8BA1;&#x7B97;&#x51FA;&#x8F93;&#x51FA;<code>y</code>&#x4E86;&#x3002;</p>
<pre><code class="lang-python">a = tf.matmul(X, W1)
y = tf.matmul(a, W2)
</code></pre>
<p>&#x7531;&#x4E8E;&#x9700;&#x8981;&#x8BA1;&#x7B97;&#x7ED3;&#x679C;&#xFF0C;&#x5C31;&#x8981;&#x7528;<code>with</code>&#x7ED3;&#x6784;&#x5B9E;&#x73B0;&#xFF0C;&#x6240;&#x6709;&#x53D8;&#x91CF;&#x521D;&#x59CB;&#x5316;&#x8FC7;&#x7A0B;&#x3001;&#x8BA1;&#x7B97;&#x8FC7;&#x7A0B;&#x90FD;&#x8981;&#x653E;&#x5230; <code>sess.run</code>&#x51FD;&#x6570;&#x4E2D;&#x3002;&#x5BF9;&#x4E8E;&#x53D8;&#x91CF;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x6211;&#x4EEC;&#x5728;<code>sess.run</code>&#x4E2D;&#x5199;&#x5165; <code>tf.global_variables_initializer</code> &#x5B9E;&#x73B0;&#x5BF9;&#x6240;&#x6709;&#x53D8;&#x91CF;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8D4B;&#x521D;&#x503C;&#x3002;&#x5BF9; &#x4E8E;&#x8BA1;&#x7B97;&#x56FE;&#x4E2D;&#x7684;&#x8FD0;&#x7B97;&#xFF0C;&#x6211;&#x4EEC;&#x76F4;&#x63A5;&#x628A;&#x8FD0;&#x7B97;&#x8282;&#x70B9;&#x586B;&#x5165; <code>sess.run</code>&#x5373;&#x53EF;&#xFF0C;&#x6BD4;&#x5982;&#x8981;&#x8BA1;&#x7B97;&#x8F93;&#x51FA;<code>y</code>&#xFF0C;&#x76F4;&#x63A5;&#x5199;<code>sess.run(y)</code>&#x5373;&#x53EF;&#x3002;</p>
<p>&#x5728;&#x5B9E;&#x9645;&#x5E94;&#x7528;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4E00;&#x6B21;&#x5582;&#x5165;&#x4E00;&#x7EC4;&#x6216;&#x591A;&#x7EC4;&#x8F93;&#x5165;&#xFF0C;&#x8BA9;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x8BA1;&#x7B97;&#x8F93;&#x51FA;<code>y</code>&#xFF0C;&#x53EF;&#x4EE5;&#x5148;&#x7528; <code>tf.placeholder</code>&#x7ED9;&#x8F93;&#x5165;&#x5360;&#x4F4D;&#x3002;&#x5982;&#x679C;&#x4E00;&#x6B21;&#x5582;&#x4E00;&#x7EC4;&#x6570;&#x636E;<code>shape</code>&#x7684;&#x7B2C;&#x4E00;&#x7EF4;&#x4F4D;&#x7F6E;&#x5199;1&#xFF0C;&#x7B2C;&#x4E8C;&#x7EF4;&#x4F4D;&#x7F6E;&#x770B;&#x6709;&#x51E0;&#x4E2A;&#x8F93;&#x5165;&#x7279;&#x5F81;;&#x5982;&#x679C;&#x4E00;&#x6B21;&#x60F3;&#x5582;&#x591A;&#x7EC4;&#x6570;&#x636E;&#xFF0C;<code>shape</code>&#x7684;&#x7B2C;&#x4E00;&#x7EF4;&#x4F4D;&#x7F6E;&#x53EF;&#x4EE5;&#x5199;<code>None</code> &#x8868;&#x793A;&#x5148;&#x7A7A;&#x7740;&#xFF0C;&#x7B2C;&#x4E8C;&#x7EF4;&#x4F4D;&#x7F6E;&#x5199;&#x6709;&#x51E0;&#x4E2A;&#x8F93;&#x5165;&#x7279;&#x5F81;&#x3002;&#x8FD9;&#x6837;&#x5728;<code>feed_dict</code>&#x4E2D;&#x53EF;&#x4EE5;&#x5582;&#x5165;&#x82E5;&#x5E72;&#x7EC4;&#x4F53;&#x79EF;&#x91CD;&#x91CF;&#x4E86;&#x3002;</p>
<h5 id="&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x7684;tensorflow&#x63CF;&#x8FF0;">&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x7684;tensorflow&#x63CF;&#x8FF0;:</h5>
<p>&#x53D8;&#x91CF;&#x521D;&#x59CB;&#x5316;&#x3001;&#x8BA1;&#x7B97;&#x56FE;&#x8282;&#x70B9;&#x8FD0;&#x7B97;&#x90FD;&#x8981;&#x7528;&#x4F1A;&#x8BDD;(with &#x7ED3;&#x6784;)&#x5B9E;&#x73B0;</p>
<pre><code class="lang-python"><span class="hljs-keyword">with</span> tf.Session() <span class="hljs-keyword">as</span> sess:
  sess.run()
</code></pre>
<p>&#x53D8;&#x91CF;&#x521D;&#x59CB;&#x5316;:&#x5728;<code>sess.run</code>&#x51FD;&#x6570;&#x4E2D;&#x7528; <code>tf.global_variables_initializer()</code>&#x6C47;&#x603B;&#x6240;&#x6709;&#x5F85;&#x4F18;&#x5316;&#x53D8;&#x91CF;&#x3002;</p>
<pre><code class="lang-python">init_op = tf.global_variables_initializer() 
sess.run(init_op)
</code></pre>
<p>&#x8BA1;&#x7B97;&#x56FE;&#x8282;&#x70B9;&#x8FD0;&#x7B97;:&#x5728;<code>sess.run</code>&#x51FD;&#x6570;&#x4E2D;&#x5199;&#x5165;&#x5F85;&#x8FD0;&#x7B97;&#x7684;&#x8282;&#x70B9;
<code>sess.run(y)</code></p>
<p>&#x7528;<code>tf.placeholder</code>&#x5360;&#x4F4D;&#xFF0C;&#x5728;<code>sess.run</code>&#x51FD;&#x6570;&#x4E2D;&#x7528;<code>feed_dict</code>&#x5582;&#x6570;&#x636E; </p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5582;&#x4E00;&#x7EC4;&#x6570;&#x636E;</span>
x = tf.placeholder(tf.float32, shape=(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>))
sess.run(y, feed_dict={x: [[<span class="hljs-number">0.5</span>,<span class="hljs-number">0.6</span>]]})
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5582;&#x591A;&#x7EC4;&#x6570;&#x636E;</span>
x = tf.placeholder(tf.float32, shape=(<span class="hljs-keyword">None</span>, <span class="hljs-number">2</span>))
sess.run(y, feed_dict={x: [[<span class="hljs-number">0.1</span>,<span class="hljs-number">0.2</span>],[<span class="hljs-number">0.2</span>,<span class="hljs-number">0.3</span>],[<span class="hljs-number">0.3</span>,<span class="hljs-number">0.4</span>],[<span class="hljs-number">0.4</span>,<span class="hljs-number">0.5</span>]]})
</code></pre>
<p>&#x4E3E;&#x4F8B;</p>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x5B9E;&#x73B0;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#xFF0C;&#x7F51;&#x7EDC;&#x53EF;&#x4EE5;&#x81EA;&#x52A8;&#x63A8;&#x7406;&#x51FA;&#x8F93;&#x51FA;<code>y</code>&#x7684;&#x503C;&#x3002;</p>
<p>(1)&#x7528;<code>placeholder</code>&#x5B9E;&#x73B0;&#x8F93;&#x5165;&#x5B9A;&#x4E49;(<code>sess.run</code>&#x4E2D;&#x5582;&#x5165;&#x4E00;&#x7EC4;&#x6570;&#x636E;)&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x7B2C;&#x4E00;&#x7EC4;&#x5582;&#x4F53;&#x79EF;0.7&#x3001;&#x91CD;&#x91CF;0.5</p>
<pre><code class="lang-python"><span class="hljs-comment">#coding:utf-8</span>
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-comment">#&#x5B9A;&#x4E49;&#x8F93;&#x5165;&#x548C;&#x53C2;&#x6570;</span>
x=tf.placeholder(tf.float32,shape=(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>)) 
w1=tf.Variable(tf.random_normal([<span class="hljs-number">2</span>,<span class="hljs-number">3</span>],stddev=<span class="hljs-number">1</span>,seed=<span class="hljs-number">1</span>)) 
w2=tf.Variable(tf.random_normal([<span class="hljs-number">3</span>,<span class="hljs-number">1</span>],stddev=<span class="hljs-number">1</span>,seed=<span class="hljs-number">1</span>))
<span class="hljs-comment">#&#x5B9A;&#x4E49;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;</span>
a=tf.matmul(x,w1)
y=tf.matmul(a,w2)
<span class="hljs-comment">#&#x7528;&#x4F1A;&#x8BDD;&#x8BA1;&#x7B97;&#x7ED3;&#x679C;</span>
<span class="hljs-keyword">with</span> tf.Session() <span class="hljs-keyword">as</span> sess:
  init_op=tf.global_variables_initializer()
  sess.run(init_op)
  print(<span class="hljs-string">&quot;y is:\n&quot;</span>,sess.run(y,feed_dict={x:[[<span class="hljs-number">0.7</span>,<span class="hljs-number">0.5</span>]]}))
</code></pre>
<p>(2)&#x7528;<code>placeholder</code>&#x5B9E;&#x73B0;&#x8F93;&#x5165;&#x5B9A;&#x4E49;(<code>sess.run</code>&#x4E2D;&#x5582;&#x5165;&#x591A;&#x7EC4;&#x6570;&#x636E;)&#x7684;&#x60C5;&#x51B5;
&#x7B2C;&#x4E00;&#x7EC4;&#x5582;&#x4F53;&#x79EF;0.7&#x3001;&#x91CD;&#x91CF;0.5&#xFF0C;&#x7B2C;&#x4E8C;&#x7EC4;&#x5582;&#x4F53;&#x79EF; 0.2&#x3001;&#x91CD;&#x91CF;0.3&#xFF0C;&#x7B2C;&#x4E09;&#x7EC4;&#x5582;&#x4F53;&#x79EF;0.3&#x3001;&#x91CD;&#x91CF; 0.4&#xFF0C;&#x7B2C;&#x56DB;&#x7EC4;&#x5582;&#x4F53;&#x79EF;0.4&#x3001;&#x91CD;&#x91CF;0.5</p>
<pre><code class="lang-python"><span class="hljs-comment">#coding:utf-8</span>
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-comment">#&#x5B9A;&#x4E49;&#x8F93;&#x5165;&#x548C;&#x53C2;&#x6570; </span>
x=tf.placeholder(tf.float32,shape=(<span class="hljs-keyword">None</span>,<span class="hljs-number">2</span>))
w1=tf.Variable(tf.random_normal([<span class="hljs-number">2</span>,<span class="hljs-number">3</span>],stddev=<span class="hljs-number">1</span>,seed=<span class="hljs-number">1</span>)) 
w2=tf.Variable(tf.random_normal([<span class="hljs-number">3</span>,<span class="hljs-number">1</span>],stddev=<span class="hljs-number">1</span>,seed=<span class="hljs-number">1</span>)) 
<span class="hljs-comment">#&#x5B9A;&#x4E49;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;</span>
a=tf.matmul(x,w1)
y=tf.matmul(a,w2)
<span class="hljs-comment">#&#x7528;&#x4F1A;&#x8BDD;&#x8BA1;&#x7B97;&#x7ED3;&#x679C;</span>
<span class="hljs-keyword">with</span> tf.Session() <span class="hljs-keyword">as</span> sess:
  init_op=tf.global_variables_initializer()
  sess.run(init_op)
  print(<span class="hljs-string">&quot;y is:\n&quot;</span>,sess.run(y,feed_dict={x:[[<span class="hljs-number">0.7</span>,<span class="hljs-number">0.5</span>], [<span class="hljs-number">0.2</span>,<span class="hljs-number">0.3</span>],[<span class="hljs-number">0.3</span>,<span class="hljs-number">0.4</span>]&#xFF0C;[<span class="hljs-number">0.4</span>,<span class="hljs-number">0.5</span>]]}))
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; scottdu 2018 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-09-18 19:09:43
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="section1.1.html" class="navigation navigation-prev " aria-label="Previous page: 第一节 张量、计算图、会话">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="section1.3.html" class="navigation navigation-next " aria-label="Next page: 第三节 反向传播">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第二节 前向传播","level":"1.2.2","depth":2,"next":{"title":"第三节 反向传播","level":"1.2.3","depth":2,"path":"chapter1/section1.3.md","ref":"chapter1/section1.3.md","articles":[]},"previous":{"title":"第一节 张量、计算图、会话","level":"1.2.1","depth":2,"path":"chapter1/section1.1.md","ref":"chapter1/section1.1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["katex","expandable-chapters-small","tbfed-pagefooter","alerts","copy-code-button","puml","graph","chart","klipse","donate","simple-page-toc","splitter"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy scottdu 2018","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"graph":{},"donate":{"alipay":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-alipay1.jpeg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-wechatpay.png","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"alerts":{},"expandable-chapters-small":{},"copy-code-button":{},"klipse":{"myConfigKey":"it's the default value"},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"chart":{"type":"c3"}},"theme":"default","author":"scottdu","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Tensorflow学习笔记","language":"zh-hans","gitbook":"3.2.3","description":"记录Tensorflow的学习内容"},"file":{"path":"chapter1/section1.2.md","mtime":"2018-09-18T11:09:43.338Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-25T05:55:22.995Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

